package common

import (
	"math"
	"unicode"
)

const (
	ProtocolName = "dev_gw"
	ProcessName  = "dev_gw"

	ConfigFilePath = "/apps/dev_gw"
)

var Version = "V1.1.0"

func Round(num float64, retain int) float64 {
	if retain <= 0 {
		return num
	}

	return math.Round(num*math.Pow(10, float64(retain))) / math.Pow(10, float64(retain))
}

func IsDigits(s string) bool {
	for _, r := range s {
		if !unicode.IsDigit(r) {
			return false
		}
	}
	return true
}
